# -*- coding: utf-8 -*-
"""
Created on Sat Oct 12 08:15:40 2024

@author: Administrator
"""
import pandas as pd

# 序列创建
names = pd.Series(['alice', 'bob', 'david'])
names_class1 = pd.Series(['alice', 'bob', 'david'], index=['0101', '0102', '0103'])

# 序列属性
name_array = names_class1.values
index_name = names_class1.index

# 序列方法
s5 = pd.Series([1, 2, 2, 3, 'hq', 'hq', 'he'])  # 定义列表s5
# 去重
s5_uniqued = s5.unique()
# 计数
s5_counts = s5.value_counts()